package sql

import org.apache.spark.SparkConf
import org.apache.spark.sql._

object SparkSql5 {
  //自定义聚合函数类，需要继承Aggregator
  def main(args:Array[String]):Unit= {
    val sparkconf = new SparkConf().setMaster("local[*]").setAppName("sparkSql")
    val spark = SparkSession.builder().config(sparkconf).getOrCreate()
    spark.sql("show databases").show()
    spark.sql("show tables").show()

    spark.close()

  }

}

